package com.warren.entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author warren
 * @data: 2022/3/28 10:20 AM
 * @decription:
 */
//类需要实现序列号接口，否者无法存入redis数据库
@Data
@AllArgsConstructor
public class Student implements Serializable {
    //可以把JSONField配置在字段或者getter/setter
    @JSONField(name = "ID", ordinal = 0)
    private Integer id;

    @JSONField(ordinal = 1, alternateNames = {"NAME", "Name"})
    private String name;

    @JSONField(ordinal = 2)
    private Double score;

    @JSONField(format = "yyyyMMdd", ordinal = 3)
    private Date birthday;
}
